package com.one.blocks.rbac.constant;

import lombok.experimental.UtilityClass;

/**
 * @author linfuxin Created on 2022-02-14 14:18:42
 */
@UtilityClass
public class RbacConstant {

    public static final Integer DEFAULT_TENANT_ID = 1;

    public static final String ADMIN_PERMISSION = "*";

    public static final String PERMS_SPLIT = ",";

    public static final String CONVERT_CREATE_NAME = "createName";

    public static final String CONVERT_UPDATE_NAME = "updateName";

    public static final String HEADER_PLATFORM_KEY = "platform";
    public static final String HEADER_PLATFORM_MINI_APP = "miniApp";

    public static final String REQUEST_ERROR_KEY = "bizException";

    public static final Integer ROOT_ID = 0;

    public static final Integer ROOT_LEVEL = 1;

    public static final class TokenCache {
        public static final String AREA = "token";
        public static final String NAME = "token:";
    }

    public static final class RoleCache {
        public static final String AREA = "role";
        public static final String ID = "id:";
        public static final String USER_ID = "userId:";
    }

    public static final class OrgCache {
        public static final String AREA = "org";

        public static final String TREE = "tree";
        public static final String ROLE_ID = "roleId:";
    }

    public static final class UserCache {
        public static final String AREA = "user";
        public static final String ID = "id:";
    }

    public static final class MenuCache {
        public static final String AREA = "menu";
        public static final String PERMS_ROLE_ID = "perms:roleId:";
        public static final String PERMS_ROLE_TYPE = "perms:roleType:";
        public static final String MENU_ROLE_ID = "roleId:";
        public static final String MENU_ROLE_TYPE = "roleType:";
    }
}
